package algorithm.poj.p1000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;

/**
 * 分析：
 * 
 * 实现：
 * 经验：
 * 教训：
 * 分类：数学 Fibnacci
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P1953 {

	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P1953.class.getResource("P1953.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));

		String line = stdin.readLine();
		int N = Integer.valueOf(line.trim());
		for (int i = 0; i < N; i ++) {
			int m = Integer.valueOf(stdin.readLine().trim());
			System.out.println("Scenario #" + (i+1) + ":\n" + f(m) + "\n");
		}
	}

	private static long f(int m) {
		
		long a = 1;
		long b = 1;
		int c = 0;
		while (c < m) {
			long t = a;
			a = b;
			b += t;
			c ++;
		}
		return b;
	}
	
	
}